#include "sine_func.h"
#include <math.h>

#ifdef _WIN32
#   include "math_defs.h" // Microsoft decided we didn't need them anymore in math.h 
#endif


sine_func::sine_func(float a, float w, float phase_offset) : ampli(a) , k( (2.0f * (float)M_PI) / w ) , psi(phase_offset) {}

float sine_func::operator()(float x)
{
    return ampli * sin(k * x + psi);
}

float sine_func::dereiv(float x)
{
    return k * ampli * cos(k * x + psi);
}
